<template>
  <div>
    <Row :gutter="16">
      <i-col span="24">
        <Card dis-hover>
          <Row>
            <i-col span="8">
              <cascaderDom class="query-form-el" ref='queryOrgCascader' @setOrgInfo='setQueryCompanyId'
                           :orgTree="true" @setOrgname="setQueryCompanyName"
                           :setCurrentName="{label: companyInfo.companyName,value:companyInfo.companyId}"></cascaderDom>
            </i-col>
            <i-col span="8">
              <Button @click="reset" class="ivu-btn-reset">重置</Button>
            </i-col>
          </Row>
        </Card>
      </i-col>
    </Row>
    <Row :gutter="16" style="margin-top: 15px">
      <i-col span="24">
        <List border>
          <ListItem>
            <Row :gutter="16" style="width: 100%">
              <i-col span="6">
                企业名称：{{ companyInfo.companyName }}
              </i-col>
              <i-col span="6">
                法人代表：{{ companyInfo.legalName }}
              </i-col>
              <i-col span="6">
                消防重点单位：
              </i-col>
              <i-col span="6">
                重点排污单位：{{ companyInfo.isPullate == 0 ? '是' : companyInfo.isPullate == 1 ? '否' : '' }}
              </i-col>
            </Row>
          </ListItem>
          <ListItem>
            <Row :gutter="16" style="width: 100%">
              <i-col span="6">
                安全环保从业人数：{{ companyInfo.staffNumber }}
              </i-col>
              <i-col span="6">
                归属地区：{{ companyInfo.attriEreaName }}
              </i-col>
              <i-col span="6">
                安全总监：{{ companyInfo.securityDirectorName }}
              </i-col>
              <i-col span="6">
                安全部门负责人：{{ companyInfo.saPersonName }}
              </i-col>
            </Row>
          </ListItem>
          <ListItem>
            <Row :gutter="16" style="width: 100%">
              <i-col span="6">
                安全部门负责人电话：{{ companyInfo.saPhone }}
              </i-col>
              <i-col span="6">
                环保部门负责人：{{ companyInfo.enPersonName }}
              </i-col>
              <i-col span="6">
                环保部门负责人电话：{{ companyInfo.enPhone }}
              </i-col>
              <i-col span="6">
                注安师：{{ companyInfo.certifiedEngineerName }}
              </i-col>
            </Row>
          </ListItem>
          <ListItem>
            <Row :gutter="16" style="width: 100%">
              <i-col span="6">
                安全标准化评价：{{ companyInfo.stdRank }}
              </i-col>
              <i-col span="6">
                标准化自评：{{ companyInfo.selfAssessmentLevel }}
              </i-col>
              <i-col span="6">
                自评得分：{{ companyInfo.selfAssessmentScore }}
              </i-col>
              <i-col span="6">
              </i-col>
            </Row>
          </ListItem>
        </List>
      </i-col>
    </Row>
    <Row :gutter="16" style="margin-top: 15px">
      <i-col span="6">
        <Card dis-hover>
          <template #title>
            <span class="span_title">性别</span>
          </template>
          <div style="height: 200px; width: 100%" ref="container1"></div>
        </Card>
      </i-col>
      <i-col span="6">
        <Card dis-hover>
          <template #title>
            <span class="span_title">年龄</span>
          </template>
          <div style="height: 200px; width: 100%" ref="container2"></div>
        </Card>
      </i-col>
      <i-col span="6">
        <Card dis-hover>
          <template #title>
            <span class="span_title">学历分布</span>
          </template>
          <div style="height: 200px; width: 100%" ref="container3"></div>
        </Card>
      </i-col>
      <i-col span="6">
        <Card dis-hover>
          <template #title>
            <span class="span_title">工作年限</span>
          </template>
          <div style="height: 200px; width: 100%" ref="container4"></div>
        </Card>
      </i-col>
    </Row>
    <Row :gutter="16" style="margin-top: 15px">
      <i-col span="6">
        <Card dis-hover>
          <template #title>
            <span class="span_title">培训情况</span>
            <DatePicker type="year" placeholder="Select date" style="width: 60%" v-model="year1"
                        @on-change="yearChange1" :clearable=false></DatePicker>
          </template>
          <div style="height: 300px; width: 100%" ref="container5"></div>
        </Card>
      </i-col>
      <i-col span="6">
        <Card dis-hover>
          <template #title>
            <span class="span_title">公司会议</span>
            <DatePicker type="year" placeholder="Select date" style="width: 60%" v-model="year2"
                        @on-change="yearChange2" :clearable=false></DatePicker>
          </template>
          <div style="height: 300px; width: 100%" ref="container6"></div>
        </Card>
      </i-col>
      <i-col span="6">
        <Card dis-hover>
          <template #title>
            <span class="span_title">相关方作业</span>
            <DatePicker type="year" placeholder="Select date" style="width: 50%" v-model="year3"
                        @on-change="yearChange3" :clearable=false></DatePicker>
          </template>
          <div style="height: 300px; width: 100%" ref="container7"></div>
        </Card>
      </i-col>
      <i-col span="6">
        <Card dis-hover>
          <template #title>
            <span class="span_title">作业许可</span>
            <DatePicker type="year" placeholder="Select date" style="width: 60%" v-model="year4"
                        @on-change="yearChange4" :clearable=false></DatePicker>
          </template>
          <div style="height: 300px; width: 100%" ref="container8"></div>
        </Card>
      </i-col>
    </Row>
    <Row :gutter="16" style="margin-top: 15px">
      <i-col span="12">
        <Row :gutter="16">
          <i-col span="12">
            <Card dis-hover>
              <template #title>
                <span class="span_title">检维修作业</span>
                <DatePicker type="year" placeholder="Select date" style="width: 50%" v-model="year5"
                            @on-change="yearChange5" :clearable=false></DatePicker>
              </template>
              <div style="height: 182px; width: 100%" ref="container9"></div>
            </Card>
          </i-col>
          <i-col span="12">
            <Card dis-hover>
              <template #title>
                <span class="span_title">风险等级</span>
                <DatePicker type="year" placeholder="Select date" style="width: 50%" v-model="year6"
                            @on-change="yearChange6" :clearable=false></DatePicker>
              </template>
              <div style="height: 182px; width: 100%" ref="container10"></div>
            </Card>
          </i-col>
        </Row>
        <Row :gutter="16" style="margin-top: 15px">
          <i-col span="24">
            <Card dis-hover>
              <template #title>
                <span class="span_title">隐患整改统计月</span>
                <DatePicker type="month" placeholder="Select date" style="width: 60%" v-model="year7"
                            @on-change="yearChange7" :clearable=false></DatePicker>
              </template>
              <div style="height: 247px; width: 100%" ref="container11"></div>
            </Card>
          </i-col>
        </Row>
      </i-col>
      <i-col span="12">
        <Row :gutter="16">
          <i-col span="24">
            <Row :gutter="16" style="height: 136px; ">
              <i-col span="12">
                <div style="width: 100%; height:100%;cursor: pointer" @click="toViewJC()">
                  <div class="info_div_left">
                    <img src="../../../assets/door/zfaqjc.png"/>
                  </div>
                  <div class="info_div_right">
                    <span>政府安全检查</span><br/>
                    <span>{{ statisticsInfos.totalSaInspect2 }}次</span>
                  </div>
                </div>
              </i-col>
              <i-col span="12">
                <div style="width: 100%; height:100%;cursor: pointer" @click="toViewAQXZ()">
                  <div class="info_div_left">
                    <img src="../../../assets/door/gsxgts.png"/>
                  </div>
                  <div class="info_div_right">
                    <span>安全行政处罚</span><br/>
                    <span>{{ statisticsInfos.furloughNum }}次</span>
                  </div>
                </div>
              </i-col>
            </Row>
            <Row :gutter="16" style="height: 136px;">
              <i-col span="12">
                <div style="width: 100%; height:100%;cursor: pointer" @click="toViewZSSW()">
                  <div class="info_div_left">
                    <img src="../../../assets/door/zsswrs.png"/>
                  </div>
                  <div class="info_div_right">
                    <span>重伤以上事故</span><br/>
                    <span>{{ statisticsInfos.dead }}起</span>
                  </div>
                </div>
              </i-col>
              <i-col span="12">
                <div style="width: 100%; height:100%;cursor: pointer" @click="toViewZWUTQYJ()">
                  <div class="info_div_left">
                    <img src="../../../assets/door/wrtqyj.png"/>
                  </div>
                  <div class="info_div_right">
                    <span>重污染天气预警</span><br/>
                    <span>{{ statisticsInfos.warningDays }}天</span>
                  </div>
                </div>
              </i-col>
            </Row>
          </i-col>
        </Row>
        <Row :gutter="16" style="margin-top: 15px">
          <i-col span="24">
            <Card dis-hover>
              <template #title>
                <span class="span_title">安全事故统计</span>
              </template>
              <div style="height: 247px; width: 100%" ref="container12"></div>
            </Card>
          </i-col>
        </Row>
      </i-col>
    </Row>
    <Modal :transfer=false v-model="StatisticsVisible" :width=1200 footer-hide>
      <Tabs value="name1" ref="tabs">
        <TabPane :label="StaffTitle" name="name1">
          <Table ref='table' v-if="AQJCVisible" :loading="loading" size="small" class="table" :height=500
                 no-data-text="没有查询到相关数据!"
                 highlight-row stripe border :columns="AQJCColumns" width="100%" :data="dataTable">
          </Table>
          <Table ref='table' v-if="ZDWRVisible" :loading="loading" size="small" class="table" :height=500
                 no-data-text="没有查询到相关数据!"
                 highlight-row stripe border :columns="ZDWRColumns" width="100%" :data="dataTable">
          </Table>
          <Table ref='table' v-if="ZSSWVisible" :loading="loading" size="small" class="table" :height=500
                 no-data-text="没有查询到相关数据!"
                 highlight-row stripe border :columns="ZSSWColumn" width="100%" :data="dataTable">
          </Table>
          <Table ref='table' v-if="AQXZVisible" :loading="loading" size="small" class="table" :height=500
                 no-data-text="没有查询到相关数据!"
                 highlight-row stripe border :columns="AQXZColumn" width="100%" :data="dataTable">
          </Table>
          <Table ref='table' v-if="AQSGVisible" :loading="loading" size="small" class="table" :height=450
                 no-data-text="没有查询到相关数据!"
                 highlight-row stripe border :columns="ZSSWColumn" width="100%"
                 :data="dataTable">
          </Table>
          <Page :total="pagedata.total" :page-size="pagedata.pageSize"
                @on-change="pageChange" @on-page-size-change='sizeChange' show-total show-sizer show-elevator/>
        </TabPane>
        <TabPane label="统计分析" v-if="ZDWRVisible != true && AQSGVisible != true" name="name2">
          <div ref="analysisContainer" style="width: 1200px; height: 500px"></div>
        </TabPane>
      </Tabs>
    </Modal>
    <Modal :title="StaffTitle" :transfer=false v-model="StaffVisible" :width=1200 footer-hide>
      <Table ref='table' :loading="loading" size="small" class="table" :height=500 no-data-text="没有查询到相关数据!"
             highlight-row stripe border :columns="StaffColumns" width="100%" :data="StaffInfo">
      </Table>
      <Page :total="pagedata.total" :page-size="pagedata.pageSize"
            @on-change="pageChange" @on-page-size-change='sizeChange' show-total show-sizer show-elevator/>
    </Modal>
    <Modal :title="StaffTitle" :transfer=false v-model="meetingRecordVisible" :width=1200 footer-hide>
      <Table ref='table' :loading="loading" size="small" class="table" :height=500 no-data-text="没有查询到相关数据!"
             highlight-row stripe border :columns="meetingRecordcolumns" width="100%" :data="meetingRecordInfo">
      </Table>
      <Page :total="pagedata.total" :page-size="pagedata.pageSize"
            @on-change="pageChange" @on-page-size-change='sizeChange' show-total show-sizer show-elevator/>
    </Modal>
    <Modal :title="StaffTitle" :transfer=false v-model="trainingRecordVisible" :width=1200 footer-hide>
      <Table ref='table' :loading="loading" size="small" class="table" :height=500 no-data-text="没有查询到相关数据!"
             highlight-row stripe border :columns="trainingRecordColumns" width="100%" :data="trainingRecordInfo">
      </Table>
      <Page :total="pagedata.total" :page-size="pagedata.pageSize"
            @on-change="pageChange" @on-page-size-change='sizeChange' show-total show-sizer show-elevator/>
    </Modal>
    <Modal :title="StaffTitle" :transfer=false v-model="trainingScheduleVisible" :width=1200 footer-hide>
      <Table ref='table' :loading="loading" size="small" class="table" :height=500 no-data-text="没有查询到相关数据!"
             highlight-row stripe border :columns="trainingScheduleColumns" width="100%" :data="trainingScheduleInfo">
      </Table>
      <Page :total="pagedata.total" :page-size="pagedata.pageSize"
            @on-change="pageChange" @on-page-size-change='sizeChange' show-total show-sizer show-elevator/>
    </Modal>
    <Modal :title="StaffTitle" :transfer=false v-model="WorkingRelatedRartiesVisible" :width=1200 footer-hide>
      <Table ref='table' :loading="loading" size="small" class="table" :height=500 no-data-text="没有查询到相关数据!"
             highlight-row stripe border :columns="WorkingRelatedRartiesColumns" width="100%"
             :data="WorkingRelatedRartiesInfo">
      </Table>
      <Page :total="pagedata.total" :page-size="pagedata.pageSize"
            @on-change="pageChange" @on-page-size-change='sizeChange' show-total show-sizer show-elevator/>
    </Modal>
    <Modal :title="StaffTitle" :transfer=false v-model="ExamRecordVisible" :width=1200 footer-hide>
      <Table ref='table' :loading="loading" size="small" class="table" :height=500 no-data-text="没有查询到相关数据!"
             highlight-row stripe border :columns="ExamRecordColumns" width="100%"
             :data="ExamRecordInfo">
      </Table>
      <Page :total="pagedata.total" :page-size="pagedata.pageSize"
            @on-change="pageChange" @on-page-size-change='sizeChange' show-total show-sizer show-elevator/>
    </Modal>
    <Modal :title="ZYXKTitle" :transfer=false v-model="ZYXKVisible" :width=1200 footer-hide>
      <Table ref='table' :loading="loading" size="small" class="table" :height=500 no-data-text="没有查询到相关数据!"
             highlight-row stripe border :columns="ZYXKColumns" width="100%" :data="ZYXKInfo">
      </Table>
      <Page :total="pagedata.total" :page-size="pagedata.pageSize"
            @on-change="pageChange" @on-page-size-change='sizeChange' show-total show-sizer show-elevator/>
    </Modal>
    <Modal :title="StaffTitle" :transfer=false v-model="hiddenDangerVisible" :width=1200 footer-hide>
      <Table ref='table' :loading="loading" size="small" class="table" :height=500 no-data-text="没有查询到相关数据!"
             highlight-row stripe border :columns="hiddenDangerColumns" width="100%" :data="hiddenDangerInfo">
      </Table>
      <Row type="flex" justify="end">
        <i-col>
          <Page :total="pagedata.total" :page-size="pagedata.pageSize"
                @on-page-size-change="sizeChange" @on-change="pageChange" show-total
                show-sizer show-elevator/>
        </i-col>
      </Row>
    </Modal>
    <Modal :title="StaffTitle" :transfer=false v-model="riskLevelVisible" :width=1200 footer-hide>
      <Menu v-show="riskLevelType!=null" mode="horizontal" @on-select='lowerStep' :active-name="modaleshow">
        <MenuItem :name="1">设备设施风险</MenuItem>
        <MenuItem :name="2">作业流程风险</MenuItem>
        <MenuItem :name="3">人员岗位风险</MenuItem>
        <MenuItem :name="4">环境氛围风险</MenuItem>
      </Menu>
      <Table :loading="loading" size="small" :height="500" class="table" no-data-text="没有查询到相关数据!"
             highlight-row stripe border :columns="riskLevelColumns" width="100%" :data="riskLevelInfo">
      </Table>
      <Page :total="pagedata.total" :page-size="pagedata.pageSize"
            @on-change="pageChange" @on-page-size-change='sizeChange' show-total show-sizer show-elevator/>
    </Modal>
  </div>
</template>

<script>
import {sessionStorage} from '@/common/cacheUtils.js';
import {Api} from '../../../api';
import echarts from 'echarts';
import cascaderDom from "../../../components/cascader-dom.vue"
import {formatDate} from "@/tools";
import pageCommonFunction from "@/components/pageCommonFunction";

export default {
  name: "comprehensivePerformance",
  components: {cascaderDom},
  data() {
    return {
      statisticsInfos: {},
      SaStaffEnvinfoType: 0,
      year: 0,
      year1: new Date(),
      year2: new Date(),
      year3: new Date(),
      year4: new Date(),
      year5: new Date(),
      year6: new Date(),
      year7: new Date(),
      companyId: sessionStorage('userId').getObject('userId').companyId,
      companyName: sessionStorage('userId').getObject('userId').companyName,
      companyInfo: {
        value: sessionStorage('userId').getObject('userId').companyId,
        label: sessionStorage('userId').getObject('userId').companyName,
      },
      dataForm: {
        grade: [],
        type: [],
      },
      pagedata: {
        total: 0, //总条数
        fromPage: 1,//从n条开始
        pageSize: 10//每页多少条
      },
      loading: false,
      AQSGVisible: false,
      riskLevelVisible: false,
      riskLevelInfo: [],
      riskLevelType: '',
      modaleshow: 1,
      riskColumns: [
        {
          title: "序号",
          minWidth: 80,
          align: "center",
          fixed: 'left',
          render: (h, params) => {
            return h('span', params.index + 1);
          }
        },
        {
          minWidth: 150,
          title: '一级风险单元',
          fixed: 'left',
          align: 'center',
          render: (h, params) => {
            return h('span', params.row.saRiskInfo.riskUnitName)
          }
        },
        {
          minWidth: 120,
          title: '二级风险单元',
          fixed: 'left',
          align: 'center',
          render: (h, params) => {
            return h('span', params.row.saRiskInfo.riskUnit2)
          }
        },
        {
          minWidth: 100,
          title: '三级风险单元',
          fixed: 'left',
          align: 'center',
          render: (h, params) => {
            return h('span', params.row.saRiskInfo.riskUnit3)
          }
        }, {
          minWidth: 100,
          title: '四级风险单元',
          fixed: 'left',
          align: 'center',
          render: (h, params) => {
            return h('span', params.row.saRiskInfo.riskUnit4)
          }
        }, {//设备
          minWidth: 100,
          title: '设备设施名称',
          align: 'center',
          render: (h, params) => {
            return h('span', params.row.saRiskInfo.equipmentName)
          }
        }, {
          minWidth: 100,
          title: '子系统单元或重要元器件',
          align: 'center',
          render: (h, params) => {
            return h('span', params.row.saRiskInfo.subEqName)
          }
        },//设备
        {
          minWidth: 100,
          title: '人员岗位',
          align: 'center',
          render: (h, params) => {
            return h('span', params.row.saRiskInfo.personnelPosition)
          }
        },
        {
          minWidth: 150,
          title: '作业内容',
          align: 'center',
          render: (h, params) => {
            return h('span', params.row.saRiskInfo.workContent)
          }
        },
        {
          minWidth: 100,
          title: '风险类别',
          align: 'center',
          key: 'riskTypeName',
          render: (h, params) => {
            return h('span', params.row.saRiskInfo.riskTypeName)
          }
        },
        {
          minWidth: 100,
          title: '风险识别维度',
          align: 'center',
          key: 'rikDiscernName',
          render: (h, params) => {
            return h('span', params.row.saRiskInfo.rikDiscernName)
          }
        },
        {
          minWidth: 100,
          title: '风险等级',
          align: 'center',
          key: 'rikRankName',
        },
        {
          minWidth: 100,
          title: '风险警示色',
          align: 'center',
          key: 'rikColor',
        },
        {
          minWidth: 150,
          title: '风险防范措施',
          align: 'center',
          key: 'manageMeasure',
          render: (h, params) => {
            return h('span', params.row.saRiskManage.manageMeasure)
          }
        },
        {
          minWidth: 150,
          title: '应急措施',
          align: 'center',
          key: 'emerMearsure',
          render: (h, params) => {
            return h('span', params.row.saRiskManage.emerMearsure)
          }
        },
      ],
      hiddenDangerInfo: [],
      hiddenDangerVisible: false,
      hiddenDangerColumns: [
        {
          title: '序号', width: 80, fixed: 'left', align: 'center', render: (h, params) => {
            return h('span', params.index + (this.pagedata.fromPage - 1) * this.pagedata.pageSize + 1);
          }
        },
        {key: 'flowNo', title: '隐患流水号', fixed: 'left', align: 'center', minWidth: 200},
        {
          key: 'companyName', title: '排查对象', fixed: 'left', align: 'center', minWidth: 200, render: (h, params) => {
            return h('div', [
              h('span', params.row.parentOrgName + '>>' + params.row.projectname || '--')
            ]);
          }
        },
        {key: 'level', title: '隐患等级', align: 'center', minWidth: 120},
        {key: 'recPeriod', title: '期限（天）', align: 'center', minWidth: 120},
        {key: 'userName', title: '上报人', align: 'center', minWidth: 120},
        {key: 'governTimeStr', title: '上报时间', align: 'center', minWidth: 150},
      ],
      ZYXKInfo: [],
      ZYXKTitle: "",
      ZYXKVisible: false,
      ZYXKColumns: [
        {
          title: '序号',
          width: 100,
          fixed: 'left',
          align: 'center',
          render: (h, params) => {
            return h('span', params.index + (this.pagedata.fromPage - 1) * this.pagedata.pageSize + 1);
          }
        },
        {
          minWidth: 150,
          title: '任务名称',
          fixed: 'left',
          key: 'planName',
          align: 'center'
        },
        {
          minWidth: 200,
          title: '所属单位',
          fixed: 'left',
          key: 'belongOrgName',
          align: 'center'
        },
        {
          minWidth: 150,
          title: '申请部门',
          fixed: 'left',
          key: 'adminDept',
          align: 'center'
        },
        {
          minWidth: 150,
          title: '作业单位',
          fixed: 'left',
          key: 'workDept',
          align: 'center'
        },
        {
          minWidth: 150,
          title: '作业等级',
          fixed: 'left',
          key: 'workGradeName',
          align: 'center'
        },
        {
          minWidth: 150,
          title: '作业开始时间',
          key: 'planStartTime',
          align: 'center',
          render: (h, params) => {
            return h('div', [
              (this.formatDate(new Date(params.row.applyStartDate), 'yyyy-MM-dd hh:mm'))
            ]);
          }
        },
        {
          minWidth: 150,
          title: '作业结束时间',
          key: 'planStartTime',
          align: 'center',
          render: (h, params) => {
            return h('div', [
              (this.formatDate(new Date(params.row.applyEndDate), 'yyyy-MM-dd hh:mm'))
            ]);
          }
        },
        {
          minWidth: 150,
          title: '作业负责人',
          key: 'workCharge',
          align: 'center',
        }
      ],
      inspectData2: ['中央安全督察组', '国家应急部', '省厅/直辖市厅', '市局', '区县及以下'],
      StaffTitle: "",
      StaffInfo: [],
      StaffVisible: false,
      StatisticsVisible: false,
      StaffColumns: [{
        title: '序号',
        width: 80,
        fixed: 'left',
        align: 'center',
        render: (h, params) => {
          return h('span', params.index + (this.pagedata.fromPage - 1) * this.pagedata.pageSize + 1);
        }
      },
        {
          key: 'secGroupName',
          title: '所属二级集团',
          align: 'center',
          minWidth: 200,
        },
        {
          key: 'staffOrgName',
          title: '单位',
          align: 'center',
          minWidth: 200,
        },
        {
          key: 'userName',
          title: '人员',
          align: 'center',
          minWidth: 100,
        },
        {
          key: 'persition',
          title: '职务或岗位分工',
          align: 'center',
          minWidth: 150,
        },
        {
          key: 'gender',
          title: '性别',
          align: 'center',
          minWidth: 120,
          render: (h, params) => {
            return h('span', params.row.genderId == 'M' ? '男' : '女')
          }
        },
        {
          key: 'birthDate',
          title: '出生年月',
          align: 'center',
          minWidth: 120,
          render: (h, params) => {
            return h('span', formatDate(new Date(params.row.birthDate), "yyyy-MM-dd"))
          }
        },
        {
          key: 'age',
          title: '年龄',
          align: 'center',
          minWidth: 120,
        },
        {
          key: 'education',
          title: '文化程度',
          align: 'center',
          minWidth: 120,
        },
        {
          key: 'email',
          title: '邮箱',
          align: 'center',
          minWidth: 120,
        },
        {
          key: 'resWork',
          title: '负责工作',
          align: 'center',
          minWidth: 120,
          render: (h, params) => {
            return h('span', params.row.resWork.split(',').length > 1 ? '安全,环保' : params.row.resWork.split(',')[0] == '1' ? '安全' : '环保')
          }
        },
        {
          key: 'cellPhone',
          title: '手机',
          align: 'center',
          minWidth: 120,
        },
        {
          key: 'createUserName',
          title: '创建人',
          align: 'center',
          minWidth: 120,
        }],
      meetingRecordInfo: [],
      meetingRecordVisible: false,
      meetingRecordcolumns: [
        {
          title: '序号', width: 80, fixed: 'left', align: 'center', render: (h, params) => {
            return h('span', params.index + (this.pagedata.fromPage - 1) * this.pagedata.pageSize + 1);
          }
        },
        {key: 'companyName', minWidth: 200, title: '企业名称', align: 'center'},
        {key: 'meetingTopics', minWidth: 150, title: '会议主题', align: 'center', tooltip: true},
        {key: 'meetingTime', minWidth: 150, title: '会议时间', align: 'center', render: this.renderCellDateTime},
        {key: 'meetingLocation', minWidth: 150, title: '会议地点', align: 'center'},
        {key: 'speaker', minWidth: 150, title: '主持人', align: 'center'},
        {key: 'meetingContent', minWidth: 150, title: '会议记录', align: 'center', tooltip: true},
        {key: 'participantLeaders', minWidth: 150, title: '参会领导', align: 'center', tooltip: true},
        {key: 'participantNumber', title: '参会人数', align: 'center', width: 130},
        // { pattern: /^(([1-9]\d*)|0)(\.\d{1})?$/, key: 'courseHours', title: '培训课时', align: 'center', width: 130 },
        {key: 'createUserName', minWidth: 150, title: '记录人', align: 'center'}],
      trainingRecordInfo: [],
      trainingScheduleVisible: false,
      trainingScheduleInfo: [],
      trainingRecordVisible: false,
      trainingRecordColumns: [
        {
          title: '序号', width: 80, fixed: 'left', align: 'center', render: (h, params) => {
            return h('span', params.index + (this.pagedata.fromPage - 1) * this.pagedata.pageSize + 1);
          }
        },
        {key: 'companyName', minWidth: 200, title: '企业名称', align: 'center'},
        {key: 'trainingTopics', minWidth: 150, title: '培训主题', align: 'center', tooltip: true},
        {
          key: 'trainingType', minWidth: 150, title: '培训类型', align: 'center', render: (h, params) => {
            return h('span', this.trainingTypesMap && this.trainingTypesMap[params.row.trainingType] && this.trainingTypesMap[params.row.trainingType].codingName)
          },
        },
        {key: 'trainingTime', minWidth: 150, title: '培训时间', align: 'center', render: this.renderCellDate},
        {key: 'trainingLocation', minWidth: 150, title: '培训地点', align: 'center', tooltip: true},
        {
          key: 'trainingMethods', minWidth: 150, title: '培训方式 ', align: 'center', render: (h, params) => {
            return h('span', this.trainingMethodsMap && this.trainingMethodsMap[params.row.trainingMethods] && this.trainingMethodsMap[params.row.trainingMethods].codingName)
          },
        },
        {key: 'speaker', minWidth: 150, title: '主讲人', align: 'center'},
        {key: 'trainingContent', minWidth: 150, title: '培训记录', align: 'center', tooltip: true},
        {key: 'trainingNumber', title: '培训人数', align: 'center', width: 130},
        {key: 'trainingHours', title: '培训课时', align: 'center', width: 130},
        {
          key: 'evaluationMethod', minWidth: 150, title: '评价方式', align: 'center', render: (h, params) => {
            return h('span', this.evaluationMethodMap && this.evaluationMethodMap[params.row.evaluationMethod] && this.evaluationMethodMap[params.row.evaluationMethod].codingName)
          },
        },
        {key: 'comprehensiveScore', minWidth: 150, title: '综合得分', align: 'center'},
        {key: 'evaluationUser', minWidth: 150, title: '评价人', align: 'center'},
        {key: 'conclusion', minWidth: 150, title: '评价结论', align: 'center'},
        {key: 'createUserName', minWidth: 150, title: '记录人', align: 'center'},
      ],
      trainingScheduleColumns: [
        {
          title: '序号', width: 80, fixed: 'left', align: 'center', render: (h, params) => {
            return h('span', params.index + (this.pagedata.fromPage - 1) * this.pagedata.pageSize + 1);
          }
        },
        {key: 'traOrgName', title: '所属单位', minWidth: 150, align: 'center'},
        {key: 'traTypeName', title: '培训类型', minWidth: 150, align: 'center'},
        {key: 'themeName', title: '培训主题', minWidth: 150, align: 'center'},
        {key: 'traName', title: '培训项目', minWidth: 150, align: 'center', tooltip: true},
        {key: 'traContent', title: '培训内容', minWidth: 150, align: 'center', tooltip: true},
        {key: 'traObjects', title: '培训对象', minWidth: 150, align: 'center', tooltip: true},
        {key: 'traDate', title: '培训时间', minWidth: 150, align: 'center', render: this.renderCellMonth},
        {key: 'traNum', title: '培训人数', minWidth: 150, align: 'center'},
        {key: 'traHours', title: '培训课时', minWidth: 150, align: 'center'},
        {key: 'traMethodsName', title: '培训方式', minWidth: 150, align: 'center'},
        {key: 'traDepartmentName', title: '承办部门', minWidth: 150, align: 'center'},
        {key: 'projectLeaderName', title: '项目负责人', minWidth: 150, align: 'center'},
      ],
      trainingMethodsMap: {},
      trainingTypesMap: {},
      evaluationMethodMap: {},
      clickParam: {},
      WorkingRelatedRartiesInfo: [],
      WorkingRelatedRartiesVisible: false,
      WorkingRelatedRartiesColumns: [
        {
          title: '序号', width: 70, fixed: 'left', align: 'center', render: (h, params) => {
            return h('span', params.index + (this.pagedata.fromPage - 1) * this.pagedata.pageSize + 1);
          }
        },
        {key: 'companyName', title: '单位名称', align: 'center', minWidth: 180,},
        {key: 'relatedPartiesName', title: '相关方名称', align: 'center', minWidth: 180,},
        {minWidth: 120, title: '相关方负责人', align: 'center', key: 'constructionDirector',},
        {minWidth: 120, title: '相关方负责人电话', align: 'center', key: 'constructionDirectorPhone',},
        {key: 'ifConcreteClean', title: '是否清库', align: 'center', minWidth: 100,},
        {key: 'workingMatters', title: '作业事项', align: 'center', minWidth: 120, tooltip: true},
        {key: 'qualificationReviewDepartment', title: '资质审核部门', align: 'center', minWidth: 120,},
        {key: 'qualificationReviewDepartmentUser', title: '资质审核部门责任人', align: 'center', minWidth: 120,},
        {key: 'territorialCompetentDepartment', title: '属地主管部门', align: 'center', minWidth: 120,},
        {key: 'territorialCompetentDepartmentUser', title: '属地主管部门责任人', align: 'center', minWidth: 120,},
        // { key:'supervisionDepartment',title: '安全环保监督部门',  align: 'center', minWidth: 120,  },
        {key: 'supervisionDepartmentUser', title: '安全环保监督部门责任人', align: 'center', minWidth: 120,},
        {key: 'businessCompetentDepartment', title: '业务主管部门', align: 'center', minWidth: 120,},
        {key: 'businessCompetentDepartmentUser', title: '业务主管部门责任人', align: 'center', minWidth: 120,},
        {
          key: 'startTime',
          title: '开始时间',
          align: 'center',
          minWidth: 120,
          sortable: "custom",
          render: this.renderCellDate
        },
        {
          key: 'playEndTime',
          title: '计划结束时间',
          align: 'center',
          minWidth: 120,
          sortable: "custom",
          render: this.renderCellDate
        },
        {minWidth: 120, title: '特种作业人员上岗证数量', align: 'center', key: 'workLicenseNumber',},
        {minWidth: 120, title: '特种作业人员数量', align: 'center', key: 'workerNumber',},
        {key: 'ifHazardousWork', title: '是否涉及危险作业', align: 'center', minWidth: 120,},
        {key: 'hazardousWorkItemName', title: '危险作业项目', align: 'center', minWidth: 120, tooltip: true},
        {key: 'ifSupervisor', title: '是否涉及监理单位', align: 'center', minWidth: 120,},
        {key: 'supervisorName', title: '监理单位名称', align: 'center', minWidth: 120,},
        {key: 'ifResident', title: '是否住场', align: 'center', minWidth: 120,},
        {
          key: 'ifApprove', title: '是否企业已审批', align: 'center', minWidth: 120,
          render: (h, params) => {
            return h('span', params.row.ifApprove == '0' ? '未审批' : params.row.ifApprove == '1' ? '审批中' : params.row.ifApprove == '2' ? '已审批' : '')
          }
        },
        {key: 'reasonsDismissal', title: '清退理由', align: 'center', minWidth: 120, tooltip: true},
        {key: 'ifBringControl', title: '相关方日常检查是否纳入管理范围', align: 'center', minWidth: 120,},
        {key: 'ifJoinMeeting', title: '是否参加属地班组安全例会', align: 'center', minWidth: 120,},
        {key: 'ifLease', title: '第三方驻地是否租赁', align: 'center', minWidth: 120,},
        {
          key: 'actualFinishingDate',
          title: '实际完成日期',
          align: 'center',
          sortable: "custom",
          minWidth: 120,
          render: this.renderCellDate
        },
        {
          key: 'workStatus', title: '作业状态', fixed: 'left', align: 'center', minWidth: 90,
          render: (h, params) => {
            return h('span', params.row.workStatus == '3' ? '计划中' : params.row.workStatus == '0' ? '进行中' : params.row.workStatus == '1' ? '已完成' : params.row.workStatus == '2' ? '延期完成' : '')
          }
        },
        {
          key: 'createDate',
          title: '填报时间',
          align: 'center',
          sortable: "custom",
          minWidth: 120,
          render: this.renderCellDate
        },
        {key: 'belongOrgName', title: '所属二级集团', align: 'center', minWidth: 180,},
      ],
      ExamRecordInfo: [],
      ExamRecordVisible: false,
      ExamRecordColumns: [{
        title: '序号',
        width: 65,
        fixed: 'left',
        align: 'center',
        render: (h, params) => {
          return h('span', params.index + (this.pagedata.fromPage - 1) * this.pagedata.pageSize + 1);
        }
      },
        {
          key: 'companyName',
          title: '企业名称',
          align: 'center',
          minWidth: 200
        },
        {
          key: 'repairStatus',
          title: '维修状态',
          minWidth: 100,
          align: 'center',
        },
        {
          key: 'isPlan',
          title: '是否计划内维修',
          minWidth: 100,
          align: 'center',
        },
        {
          key: 'repairStartTime',
          title: '检修实际开始时间',
          minWidth: 120,
          align: 'center',
          render: this.renderCellDate
        },
        {
          key: 'repairEndTime',
          title: '检维修作业结束时间',
          minWidth: 120,
          align: 'center',
          render: this.renderCellDate
        },
        {
          key: 'remarks',
          title: '备注',
          minWidth: 200,
          align: 'center',
          tooltip: true
        },
      ],
      ZSSWVisible: false,
      dataTable: [],
      AQJCVisible: false,
      ZDWRVisible: false,
      AQJCColumns: [
        {
          title: '序号', width: 80, fixed: 'left', align: 'center', render: (h, params) => {
            return h('span', params.index + (this.pagedata.fromPage - 1) * this.pagedata.pageSize + 1);
          }
        },
        {key: 'companyName', title: '被检查企业', fixed: 'left', align: 'center', width: 200},
        {key: 'belongOrgId', title: '二级集团', fixed: 'left', align: 'center', width: 200},
        {key: 'inspectionTime', title: '检查时间', align: 'center', width: 150, render: this.renderCellDate},
        {key: 'inspectionGroupCategory', title: '检查组别', align: 'center', width: 120},
        {key: 'rummager', title: '检查组人员', align: 'center', width: 200},
        {key: 'issueCount', title: '问题数量', align: 'center', width: 100},
        {key: 'issueCompletionCount', title: '整改完成问题数量', align: 'center', width: 150},
        {key: 'contentIssue', title: '检查内容及发现问题', align: 'center', width: 200, tooltip: true},
        {key: 'issueRectificationRequest', title: '问题及整改要求', align: 'center', width: 200, tooltip: true},
        {key: 'issueCompletion', title: '问题整改完成情况', align: 'center', width: 200, tooltip: true},
        {key: 'issueCompletionTime', title: '整改完成时间', align: 'center', width: 150, render: this.renderCellDate},
        {key: 'createDate', title: '填表时间', align: 'left', width: 120, render: this.renderCellDate}
      ],
      ZDWRColumns: [
        {
          title: '序号', width: 80, fixed: 'left', align: 'center', render: (h, params) => {
            return h('span', params.index + (this.pagedata.fromPage - 1) * this.pagedata.pageSize + 1);
          }
        },
        {key: 'companyName', title: '企业名称', fixed: 'left', align: 'center', width: 200},
        {key: 'belongOrgName', title: '二级集团', fixed: 'left', align: 'center', width: 150},
        {key: 'warningLevel', title: '预警级别', align: 'center', width: 120},
        {key: 'warningPeriod', title: '预警期间', align: 'center', width: 162},
        {key: 'responseMeasures', title: '响应措施', align: 'center', tooltip: true}
      ],
      ZSSWColumn: [
        {
          type: 'expand', width: 30,
          // fixed: 'left',
          render: (h, params) => {
            return h('Table', {
              props: {
                columns: [
                  {title: '伤亡人员姓名', align: 'center', key: 'victim', minWidth: 100,},
                  {
                    title: '性别', align: 'center', key: 'gender', minWidth: 80, render: (h, params) => {
                      return h('span', params.row.gender == '0' ? '男' : '女')
                    }
                  },
                  {title: '年龄', align: 'center', key: 'age', minWidth: 80,},
                  {title: '工种或岗位', align: 'center', key: 'position', minWidth: 120,},
                  {title: '伤害部位', align: 'center', key: 'injured', minWidth: 120,},
                  {title: '就业类型', align: 'center', key: 'membershipName', minWidth: 120,},
                  {title: '伤害程度', align: 'center', key: 'injuryLevelName', minWidth: 120,},
                  {title: '歇工天数', align: 'center', key: 'daysWork', minWidth: 100,},
                  {title: '直接经济损失(万元)', align: 'center', key: 'loseMoney', minWidth: 130,},
                ],//表头
                data: params.row.briefItems,//内部表格展示的数据
              },
            })//我这里使用的是表格，大家也可以根据自己的实际情况更换别的组件
          }
        },
        {
          title: '序号', width: 70, align: 'center',
          render: (h, params) => {
            return h('span', params.index + (this.pagedata.fromPage - 1) * this.pagedata.pageSize + 1);
          }
        },
        {title: '事故名称', align: 'center', key: 'sartName', minWidth: 140,},
        // {title: '伤亡人员姓名', align: 'center', key: 'victim', fixed: 'left', minWidth: 130,},
        {title: '单位', align: 'center', key: 'orgName', minWidth: 200,},
        {title: '伤害程度描述', align: 'center', key: 'injuryLevelDesc', minWidth: 180, tooltip: true},
        // {title: '伤害程度', align: 'center', key: 'injuryLevelName', minWidth: 100,},
        {title: '事故经过', align: 'center', key: 'accDesc', minWidth: 300, tooltip: true},
        {
          title: '事故发生时间', align: 'center', key: 'sartDate', minWidth: 150,
          render: (h, params) => {
            return h('div', [(this.formatDate(new Date(params.row.sartDate), 'yyyy-MM-dd'))]);
          }
        },
      ],
      AQXZVisible: false,
      AQXZColumn: [
        {
          title: '序号',
          width: 100,
          fixed: 'left',
          align: 'center',
          render: (h, params) => {
            return h('span', params.index + (this.pagedata.fromPage - 1) * this.pagedata.pageSize + 1);
          }
        },
        {key: 'twoLevelGroupName', title: '所属集团', fixed: 'left', align: 'center'},
        {key: 'companyName', title: '被罚款单位', fixed: 'left', align: 'center'},
        {key: 'fineUnitName', title: '罚款单位', align: 'center'},
        {
          key: 'fineDate', title: '罚款时间', align: 'center', render: this.renderCellDate

        },
        {key: 'fineMoney', title: '罚款金额（万元）', align: 'center'},
        {key: 'reasonsForFines', title: '罚款事由', align: 'center', ellipsis: true, tooltip: true},
        {key: 'fineDesc', title: '罚款内容描述', align: 'center', ellipsis: true, tooltip: true},
      ],
      AQHYColumn: [
        {
          title: '序号',
          width: 100,
          fixed: 'left',
          align: 'center',
          render: (h, params) => {
            return h('span', params.index + (this.pagedata.fromPage - 1) * this.pagedata.pageSize + 1);
          }
        },
        {key: 'companyName', minWidth: 200, title: '企业名称', fixed: 'left', align: 'center'},
        {key: 'meetingTopics', minWidth: 150, title: '会议主题', align: 'center', tooltip: true},
        {key: 'meetingTime', minWidth: 150, title: '会议时间', align: 'center', render: this.renderCellDateTime},
        {key: 'meetingLocation', minWidth: 150, title: '会议地点', align: 'center'},
        {
          key: 'meetingType', minWidth: 150, title: '会议类型 ', align: 'center', render: (h, params) => {
            return h('span', this.meetingTypeMap && this.meetingTypeMap[params.row.meetingType] && this.meetingTypeMap[params.row.meetingType].codingName)
          },
        },
        {key: 'speaker', minWidth: 150, title: '主持人', align: 'center'},
        {key: 'meetingContent', minWidth: 150, title: '会议记录', align: 'center', tooltip: true},
        {key: 'participantLeaders', minWidth: 150, title: '参会领导', align: 'center', tooltip: true},
        {pattern: /^([0-9][0-9]*)?$/, key: 'participantNumber', title: '参会人数', align: 'center', width: 130},
        // { pattern: /^(([1-9]\d*)|0)(\.\d{1})?$/, key: 'courseHours', title: '培训课时', align: 'center', width: 130 },
        {key: 'createUserName', minWidth: 150, title: '记录人', align: 'center'},
      ],
      PXCSColumn: [
        {
          title: '序号',
          width: 100,
          fixed: 'left',
          align: 'center',
          render: (h, params) => {
            return h('span', params.index + (this.pagedata.fromPage - 1) * this.pagedata.pageSize + 1);
          }
        },
        {key: 'companyName', minWidth: 200, title: '企业名称', fixed: 'left', align: 'center'},
        {key: 'trainingTopics', minWidth: 150, title: '培训主题', align: 'center', tooltip: true},
        {key: 'trainingTime', minWidth: 150, title: '培训时间', align: 'center', render: this.renderCellDate},
        {key: 'trainingLocation', minWidth: 150, title: '培训地点', align: 'center', tooltip: true},
        {
          key: 'trainingMethods', minWidth: 150, title: '培训方式 ', align: 'center', render: (h, params) => {
            return h('span', this.trainingMethodsMap && this.trainingMethodsMap[params.row.trainingMethods] && this.trainingMethodsMap[params.row.trainingMethods].codingName)
          },
        },
        {key: 'speaker', minWidth: 150, title: '主讲人', align: 'center'},
        {key: 'trainingContent', minWidth: 150, title: '培训记录', align: 'center', tooltip: true},
        {pattern: /^([0-9][0-9]*)?$/, key: 'trainingNumber', title: '培训人数', align: 'center', width: 130},
        {pattern: /^(([1-9]\d*)|0)(\.\d{1})?$/, key: 'trainingHours', title: '培训课时', align: 'center', width: 130},
        {
          key: 'evaluationMethod', minWidth: 150, title: '评价方式', align: 'center', render: (h, params) => {
            return h('span', this.evaluationMethodMap && this.evaluationMethodMap[params.row.evaluationMethod] && this.evaluationMethodMap[params.row.evaluationMethod].codingName)
          },
        },
        {key: 'comprehensiveScore', minWidth: 150, title: '综合得分', align: 'center'},
        {key: 'evaluationUser', minWidth: 150, title: '评价人', align: 'center'},
        {key: 'conclusion', minWidth: 150, title: '评价结论', align: 'center'},
        {key: 'createUserName', minWidth: 150, title: '记录人', align: 'center'},
      ],
      HBXZColumn: [
        {
          title: '序号',
          fixed: 'left',
          width: 100,
          align: 'center',
          render: (h, params) => {
            return h('span', params.index + (this.pagedata.fromPage - 1) * this.pagedata.pageSize + 1);
          }
        },
        {key: 'eventOrgName', title: '事件发生单位', fixed: 'left', align: 'center', minWidth: 240},
        {key: 'eventDate', title: '事件发生时间', align: 'center', render: this.renderCellDate, minWidth: 140},
        {key: 'eventSite', title: '事件发生地点', align: 'center', minWidth: 160},
        {key: 'punishmentTime', title: '事件处罚时间', align: 'center', render: this.renderCellDate, minWidth: 140},
        {
          key: 'punishmentType', title: '处罚类别', align: 'center', minWidth: 120, render: (h, params) => {
            return h('span', this.dictMap['ENEVT-000002'][params.row.punishmentType] && this.dictMap['ENEVT-000002'][params.row.punishmentType].codingName);
          }
        },
        {key: 'penaltyAmount', title: '罚款金额(万元)', align: 'center', minWidth: 120},
        {key: 'eventDescription', title: '事件经过', align: 'center', minWidth: 230, tooltip: true},
        {key: 'emergencyMeasure', title: '已经采取的应急措施', align: 'center', minWidth: 230, tooltip: true},
        {key: 'otherInformation', title: '其他应当报告的情况', align: 'center', minWidth: 230, tooltip: true}
      ],
    }
  },
  computed: {
    riskLevelColumns() {
      const columns = [...this.riskColumns];
      const modaleshow = this.modaleshow
      const riskLevelColumns = []
      columns.forEach(item => {
        if (modaleshow == 1) {
          if (item.title != '作业内容' && item.title != '人员岗位') {
            riskLevelColumns.push(item)
          }
        } else if (modaleshow == 2) {
          if (item.title != '设备设施名称' && item.title != '人员岗位' && item.title != '子系统单元或重要元器件') {
            riskLevelColumns.push(item)
          }
        } else if (modaleshow == 3) {
          if (item.title != '设备设施名称' && item.title != '作业内容' && item.title != '子系统单元或重要元器件') {
            riskLevelColumns.push(item)
          }
        } else {
          if (item.title != '设备设施名称' && item.title != '作业内容' && item.title != '人员岗位' && item.title != '子系统单元或重要元器件') {
            riskLevelColumns.push(item)
          }
        }
      })
      return riskLevelColumns
    },
  },
  async mounted() {
    await this.$http.get(Api.queryCodeDetailBySortId + '/TRA-000003', {params: {}}).then((res) => {
      this.trainingMethodsMap = this.dictListToMap(res.data.data);
    });
    await this.$http.get(Api.queryCodeDetailBySortId + '/TR-000001', {params: {}}).then((res) => {
      this.trainingTypesMap = this.dictListToMap(res.data.data);
    });
    await this.$http.get(Api.queryCodeDetailBySortId + '/TRA-000004', {params: {}}).then((res) => {
      this.evaluationMethodMap = this.dictListToMap(res.data.data);
    });
    const YEAR = new Date().getFullYear()
    this.loadChart();
    this.queryInfo();
    this.loadTrainingRecordsChart(YEAR);
    this.loadMeetingRecordsChart(YEAR);
    this.loadWorkPermitChart(YEAR);
    this.loadWorkingRelatedPartiesChart(YEAR);
    this.loadExamConstructionWorkChart(YEAR);
    this.loadDerChart(YEAR);
    this.loadHseChart(new Date());
    this.loadSafeAccident();
    this.loadCockpitCount();
    setTimeout(() => {
      this.$refs.queryOrgCascader.setCurrentOrg();
    }, 1000)
  },
  methods: {
    ...pageCommonFunction,
    sizeChange(pageSize) {
      this.pagedata.pageSize = pageSize;
      if (this.hiddenDangerVisible)
        this.queryHiddenDanger();
      if (this.trainingScheduleVisible || this.trainingRecordVisible)
        this.queryTrainingRecordInfo();
      if (this.ZSSWVisible)
        this.queryZSSW();
      if (this.AQJCVisible)
        this.queryJC();
      if (this.ZDWRVisible)
        this.queryZWUTQYJ();
      if (this.AQXZVisible)
        this.queryAQXZ();
      if (this.ExamRecordVisible)
        this.queryExamRecordInfo();
      if (this.WorkingRelatedRartiesVisible)
        this.queryWorkingRelatedRarties();
      if (this.riskLevelVisible)
        this.toViewRisk();
      if (this.meetingRecordVisible)
        this.queryMeetingRecordInfo();
      if (this.StaffVisible)
        this.querySaStaffEnvinfo()
      if (this.ZYXKVisible)
        this.queryZYXK();
      if (this.AQSGVisible)
        this.queryAQSGTJ();
    },
    pageChange(pageNum) {
      this.pagedata.fromPage = pageNum;
      if (this.hiddenDangerVisible)
        this.queryHiddenDanger();
      if (this.trainingScheduleVisible || this.trainingRecordVisible)
        this.queryTrainingRecordInfo();
      if (this.ZSSWVisible)
        this.queryZSSW();
      if (this.AQJCVisible)
        this.queryJC();
      if (this.ZDWRVisible)
        this.queryZWUTQYJ();
      if (this.AQXZVisible)
        this.queryAQXZ();
      if (this.ExamRecordVisible)
        this.queryExamRecordInfo();
      if (this.WorkingRelatedRartiesVisible)
        this.queryWorkingRelatedRarties();
      if (this.riskLevelVisible)
        this.toViewRisk();
      if (this.meetingRecordVisible)
        this.queryMeetingRecordInfo();
      if (this.StaffVisible)
        this.querySaStaffEnvinfo()
      if (this.ZYXKVisible)
        this.queryZYXK();
      if (this.AQSGVisible)
        this.queryAQSGTJ();
    },
    queryInfo() {
      this.$http.get(Api.getEnvInfoCompanByCompanyId2 + this.companyId).then((res) => {
        if (res.data.status === 200) {
          this.companyInfo = res.data.data;
        } else {
          this.$Message.error("当前公司没有在企业信息内维护");
        }
      }).catch(e => {
        this.$Message.error("当前公司没有在企业信息内维护");
      })
    },
    loadChart() {
      this.$http.get(Api.saStaffEnvinfoComprehensive, {params: {companyId: this.companyId}}).then((res) => {
        if (res.data.status === 200) {
          let gender = res.data.data.gender;
          let container1 = echarts.init(this.$refs.container1);
          if (gender != null && gender.length != 0) {
            container1.hideLoading();
            let option1 = this.getOption1();
            option1.series[0].name = '性别';
            gender.forEach(i => {
              option1.series[0].data.push({name: i.codingName, value: i.value});
              option1.legend.formatter = function (name) {
                let data = option1.series[0].data;
                let total = 0;
                let tarValue = 0;
                for (let i = 0, l = data.length; i < l; i++) {
                  total += parseInt(data[i].value);
                  if (data[i].name == name) {
                    tarValue = data[i].value;
                  }
                }
                let arr = [name, ((tarValue / total) * 100).toFixed(2) + '%']
                return arr.join('')
              }
            })
            container1.setOption(option1);
            container1.on('click', (param) => {
              event.stopPropagation()// 阻止冒泡
              this.StaffTitle = param.name
              this.clickParam = param;
              this.SaStaffEnvinfoType = "gender";
              this.StaffVisible = true;
              this.pagedata = {
                total: 0, //总条数
                fromPage: 1,//从n条开始
                pageSize: 10//每页多少条
              };
              this.querySaStaffEnvinfo();
            });
          } else {
            container1.showLoading({
              text: '暂无数据',
              showSpinner: false,
              textColor: 'black',
              maskColor: 'rgba(255, 255, 255, 1)',
              fontSize: '26px',
              fontWeight: 'bold'
            })
          }
          let age = res.data.data.age;
          let container2 = echarts.init(this.$refs.container2);
          if (age != null && age.length != 0) {
            container2.hideLoading();
            let option2 = this.getOption1();
            option2.series[0].name = '年龄';
            age.forEach(i => {
              option2.series[0].data.push({name: i.codingName, value: i.value});
            })
            option2.legend.formatter = function (name) {
              let data = option2.series[0].data;
              let total = 0;
              let tarValue = 0;
              for (let i = 0, l = data.length; i < l; i++) {
                total += parseInt(data[i].value);
                if (data[i].name == name) {
                  tarValue = data[i].value;
                }
              }
              let arr = [name]
              if (!isNaN((tarValue / total) * 100)) {
                arr = [name, ((tarValue / total) * 100).toFixed(2) + '%']
              }
              return arr.join('')
            }
            container2.setOption(option2);
            container2.on('click', (param) => {
              event.stopPropagation()// 阻止冒泡
              this.StaffTitle = param.name
              this.StaffVisible = true;
              this.clickParam = param;
              this.SaStaffEnvinfoType = "age";
              this.pagedata = {
                total: 0, //总条数
                fromPage: 1,//从n条开始
                pageSize: 10//每页多少条
              };
              this.querySaStaffEnvinfo();
            });
          } else {
            container2.showLoading({
              text: '暂无数据',
              showSpinner: false,
              textColor: 'black',
              maskColor: 'rgba(255, 255, 255, 1)',
              fontSize: '26px',
              fontWeight: 'bold'
            })
          }
          let education = res.data.data.education;
          let container3 = echarts.init(this.$refs.container3);
          if (education != null && education.length != 0) {
            container3.hideLoading();
            let option3 = this.getOption2();
            education.forEach(i => {
              option3.yAxis.data.push(i.codingName);
              option3.series[0].data.push(i.value);
            })
            container3.setOption(option3);
            container3.on('click', (param) => {
              event.stopPropagation()// 阻止冒泡
              this.StaffTitle = param.name
              this.StaffVisible = true;
              this.clickParam = param
              this.SaStaffEnvinfoType = "education"
              this.pagedata = {
                total: 0, //总条数
                fromPage: 1,//从n条开始
                pageSize: 10//每页多少条
              };
              this.querySaStaffEnvinfo();
            });
          } else {
            container3.showLoading({
              text: '暂无数据',
              showSpinner: false,
              textColor: 'black',
              maskColor: 'rgba(255, 255, 255, 1)',
              fontSize: '26px',
              fontWeight: 'bold'
            })
          }
          let workingYears = res.data.data.workingYears;
          let container4 = echarts.init(this.$refs.container4);
          if (workingYears != null && workingYears.length != 0) {
            container4.hideLoading();
            let option4 = this.getOption3();
            workingYears.forEach(i => {
              option4.xAxis.data.push(i.codingName);
              option4.series[0].data.push(i.value);
            })
            container4.setOption(option4);
            container4.on('click', (param) => {
              event.stopPropagation()// 阻止冒泡
              this.StaffTitle = param.name
              this.StaffVisible = true;
              this.clickParam = param;
              this.pagedata = {
                total: 0, //总条数
                fromPage: 1,//从n条开始
                pageSize: 10//每页多少条
              };
              this.SaStaffEnvinfoType = "year"
              this.querySaStaffEnvinfo();
            });
          } else {
            container4.showLoading({
              text: '暂无数据',
              showSpinner: false,
              textColor: 'black',
              maskColor: 'rgba(255, 255, 255, 1)',
              fontSize: '26px',
              fontWeight: 'bold'
            })
          }
        } else {
          this.$Message.error("数据操作异常");
        }
      }).catch(e => {
        this.$Message.error("没有查询到数据");
      })
    },
    loadTrainingRecordsChart(year) {
      this.$http.get(Api.comprehensivePerformanceTraining, {
        params: {
          companyId: this.companyId,
          startYear: year
        }
      }).then((res) => {
        if (res.data.status === 200) {
          let option = this.getOption4();
          let data = res.data.data;
          let container = echarts.init(this.$refs.container5);
          if (data != null && data.length != 0) {
            container.hideLoading()
            option.xAxis.data.push("安全培训");
            option.series.push({
              name: '计划',
              type: 'bar',
              data: [data['planAQ'], data['planHB']],
              itemStyle: { // 柱子样式
                color: {
                  type: 'linear',
                  x: 0,
                  y: 0,
                  x2: 1,
                  y2: 1,
                  colorStops: [{
                    offset: 0, color: '#82CDFF' // 0% 处的颜色
                  }, {
                    offset: 1, color: '#1999FF' // 100% 处的颜色
                  }],
                  global: false // 缺省为 false
                },
              },
            })
            option.series.push({
              name: '实际',
              type: 'bar',
              data: [data['actualAQ']],
              itemStyle: { // 柱子样式
                color: {
                  type: 'linear',
                  x: 0,
                  y: 0,
                  x2: 1,
                  y2: 1,
                  colorStops: [{
                    offset: 0, color: '#FBD784' // 0% 处的颜色
                  }, {
                    offset: 1, color: '#F9A23E' // 100% 处的颜色
                  }],
                  global: false // 缺省为 false
                },
              },
            });
            container.setOption(option);
            container.on('click', (param) => {
              event.stopPropagation()// 阻止冒泡
              this.StaffTitle = param.name
              this.clickParam = param;
              this.pagedata = {
                total: 0, //总条数
                fromPage: 1,//从n条开始
                pageSize: 10//每页多少条
              };
              this.queryTrainingRecordInfo();
            });
          } else {
            container.showLoading({
              text: '暂无数据',
              showSpinner: false,
              textColor: 'black',
              maskColor: 'rgba(255, 255, 255, 1)',
              fontSize: '26px',
              fontWeight: 'bold'
            })
          }
        }
      })
    },
    loadMeetingRecordsChart(year) {
      this.$http.get(Api.comprehensiveMeetingRecords, {
        params: {
          companyId: this.companyId,
          startYear: year
        }
      }).then((res) => {
        if (res.data.status === 200) {
          let data = res.data.data;
          let container = echarts.init(this.$refs.container6);
          let option = this.getOption1();
          option.legend = {};
          option.series[0].name = '公司会议';
          option.series[0].center = ['50%', '65%'];
          option.series[0].data.push({name: '公司安全例会', value: data['anquanSize']});
          option.series[0].data.push({name: '公司环保例会', value: data['huanbaoSize']});
          option.series[0].data.push({name: '党组织会议', value: data['dangzuzhiSize']});
          option.series[0].data.push({name: '公司安委会', value: data['gongsianweiSize']});
          option.legend.formatter = function (name) {
            let data = option.series[0].data;
            let total = 0;
            let tarValue = 0;
            for (let i = 0, l = data.length; i < l; i++) {
              total += parseInt(data[i].value);
              if (data[i].name == name) {
                tarValue = data[i].value;
              }
            }
            let arr = [name]
            if (!isNaN((tarValue / total) * 100)) {
              arr = [name, ((tarValue / total) * 100).toFixed(2) + '%']
            }
            return arr.join('')
          }
          container.setOption(option);
          container.on('click', (param) => {
            event.stopPropagation()// 阻止冒泡
            this.StaffTitle = param.name
            this.clickParam = param;
            this.meetingRecordVisible = true;
            this.pagedata = {
              total: 0, //总条数
              fromPage: 1,//从n条开始
              pageSize: 10//每页多少条
            };
            this.queryMeetingRecordInfo();
          });
        }
      })
    },
    loadWorkPermitChart(year) {
      this.year = year;
      let container = echarts.init(this.$refs.container8);
      let data = {
        orgId: this.companyId,
        year: year
      };
      this.$http.get(Api.statisticsPtwByPtwTypeCurrentDay, {params: data}).then(res => {
        this.dataForm.type = res.data.type;
        let option = this.getOption5();
        let legendData = [];
        let seriesData = [];
        let seriesData2 = [];
        let max = 0;
        this.dataForm.type.forEach(item => {
          if (item.ptwNum > max) {
            max = item.ptwNum;
          }
        })
        for (let i = 0; i < this.dataForm.type.length; i++) {
          legendData.push(this.dataForm.type[i].ptwTypeName);
          seriesData2.push(max + 10);
          seriesData.push((this.dataForm.type)[i].ptwNum);
        }
        option.yAxis.data = legendData;
        option.series[0].data = seriesData;
        option.series[1].data = seriesData2;
        container.setOption(option);
        container.on('click', (param) => {
          event.stopPropagation()// 阻止冒泡
          this.clickParam = param;
          this.ZYXKTitle = param.name
          this.ZYXKVisible = true;
          this.pagedata = {
            total: 0, //总条数
            fromPage: 1,//从n条开始
            pageSize: 10//每页多少条
          };
          this.queryZYXK();
        });
      });
    },
    loadWorkingRelatedPartiesChart(year) {
      this.$http.get(Api.comprehensiveWorkingRelatedParties, {
        params: {
          companyId: this.companyId,
          startYear: year
        }
      }).then((res) => {
        if (res.data.status == 200) {
          let container = echarts.init(this.$refs.container7);
          let option = this.getOption1();
          option.legend = {};
          let data = res.data.data;
          if (data != null && data.length != 0) {
            container.hideLoading()
            data.forEach(i => {
              option.series[0].center = ['50%', '65%'];
              option.series[0].data.push({
                name: i.workStatus == '3' ? '计划中' : i.workStatus == '0' ? '进行中' : i.workStatus == '1' ? '已完成' : i.workStatus == '2' ? '延期完成' : '',
                value: i.value
              });
              option.series[0].name = '相关方作业';
              option.legend.formatter = function (name) {
                let data = option.series[0].data;
                let total = 0;
                let tarValue = 0;
                for (let i = 0, l = data.length; i < l; i++) {
                  total += parseInt(data[i].value);
                  if (data[i].name == name) {
                    tarValue = data[i].value;
                  }
                }
                let arr = [name, ((tarValue / total) * 100).toFixed(2) + '%']
                return arr.join('')
              }
            })
          } else {
            container.showLoading({
              text: '暂无数据',
              showSpinner: false,
              textColor: 'black',
              maskColor: 'rgba(255, 255, 255, 1)',
              fontSize: '26px',
              fontWeight: 'bold'
            })
          }
          container.setOption(option);
          container.on('click', (param) => {
            event.stopPropagation()// 阻止冒泡
            this.StaffTitle = param.name
            this.clickParam = param;
            this.WorkingRelatedRartiesVisible = true;
            this.pagedata = {
              total: 0, //总条数
              fromPage: 1,//从n条开始
              pageSize: 10//每页多少条
            };
            this.queryWorkingRelatedRarties();
          });
        }
      })
    },
    loadExamConstructionWorkChart(year) {
      this.$http.get(Api.comprehensiveExamConstructionWork, {
        params: {
          companyId: this.companyId,
          startYear: year
        }
      }).then((res) => {
        if (res.data.status == 200) {
          let data = res.data.data;
          let container = echarts.init(this.$refs.container9);
          let option = this.getOption1();
          if (data != null && data.length != 0) {
            container.hideLoading();
            data.forEach(i => {
              option.series[0].data.push({name: i.repairStatus, value: i.value});
              option.series[0].name = '检维修作业';
              option.legend.formatter = function (name) {
                let data = option.series[0].data;
                let total = 0;
                let tarValue = 0;
                for (let i = 0, l = data.length; i < l; i++) {
                  total += parseInt(data[i].value);
                  if (data[i].name == name) {
                    tarValue = data[i].value;
                  }
                }
                let arr = [name, ((tarValue / total) * 100).toFixed(2) + '%']
                return arr.join('')
              }
            })
          } else {
            container.showLoading({
              text: '暂无数据',
              showSpinner: false,
              textColor: 'black',
              maskColor: 'rgba(255, 255, 255, 1)',
              fontSize: '26px',
              fontWeight: 'bold'
            })
          }
          container.setOption(option);
          container.on('click', (param) => {
            event.stopPropagation()// 阻止冒泡
            this.StaffTitle = param.name
            this.clickParam = param;
            this.ExamRecordVisible = true;
            this.pagedata = {
              total: 0, //总条数
              fromPage: 1,//从n条开始
              pageSize: 10//每页多少条
            };
            this.queryExamRecordInfo();
          });
        }
      })
    },
    loadDerChart(year) {
      let data = {
        orgId: this.companyId,
        year: year
      }
      let container = echarts.init(this.$refs.container10);
      this.$http.get(Api.riskStaticalList + '/count', {params: data}).then((res) => {
        if (res.data.status == 200) {
          let level = res.data.data.level;
          let option = this.getOption1();
          option.series[0].center = ['30%', '50%'],
              option.series[0].data = level;
          option.series[0].name = '风险等级';
          option.legend.formatter = function (name) {
            let data = option.series[0].data;
            let total = 0;
            let tarValue = 0;
            for (let i = 0, l = data.length; i < l; i++) {
              total += parseInt(data[i].value);
              if (data[i].name == name) {
                tarValue = data[i].value;
              }
            }
            let arr = [name, tarValue == 0 ? '0%':((tarValue / total) * 100).toFixed(2) + '%']
            return arr.join('')
          }
          container.setOption(option);
          container.on("click", (param) => {
            event.stopPropagation()// 阻止冒泡
            this.riskLevelType = param.name
            this.pagedata.fromPage = 1
            this.pagedata.pageSize = 10
            this.riskLevelVisible = true;
            this.clickParam = param;
            this.modaleshow = 1
            this.StaffTitle = this.riskLevelType === '重大' ? '风险等级(重大)' : this.riskLevelType === '较大' ? '风险等级(较大)' : '风险等级(重大,较大)'
            this.toViewRisk()
          })
        }
      });
    },
    loadHseChart(year) {
      let data = {
        orgId: this.companyId,
        month: this.formatDate(year, 'yyyy-MM'),
        lastMonth: this.getLastMonth(year, 'yyyy-MM'),
      }
      let container = echarts.init(this.$refs.container11);
      this.$http.get(Api.apsgInverstigation + '/count/all', {params: data}).then(res => {
        let option = this.getOption6();
        if (res.data.length != 0) {
          container.hideLoading()
          let seriesData = [res.data[0]['count'], res.data[1]['count'], res.data[2]['count'], res.data[3]['count']];
          option.series[0].data = seriesData;
          container.setOption(option);
          container.on('click', (param) => {
            event.stopPropagation()// 阻止冒泡
            this.StaffTitle = param.name;
            this.clickParam = param
            this.hiddenDangerVisible = true;
            this.pagedata.fromPage = 1
            this.pagedata.pageSize = 10
            this.pagedata.total = 0;
            this.queryHiddenDanger();
          });
        } else {
          container.showLoading({
            text: '暂无数据',
            showSpinner: false,
            textColor: 'black',
            maskColor: 'rgba(255, 255, 255, 1)',
            fontSize: '26px',
            fontWeight: 'bold'
          })
        }
      })
    },
    loadSafeAccident() {
      let safeAccidentContainer = echarts.init(this.$refs.container12);
      this.$http.get(Api.accidentStatistics).then(res => {
        if (res.data.status == 200) {
          let option = this.getOption7();
          option.series[0].data = res.data.data.month;
          safeAccidentContainer.setOption(option);
          safeAccidentContainer.on('click', (param) => {
            event.stopPropagation()// 阻止冒泡
            this.clickParam = param;
            this.StatisticsVisible = true;
            this.AQSGVisible = true;
            this.AQJCVisible = false;
            this.ZSSWVisible = false;
            this.ZDWRVisible = false;
            this.AQXZVisible = false;
            this.pagedata.fromPage = 1
            this.pagedata.pageSize = 10
            this.StaffTitle = '安全事故详情';
            this.queryAQSGTJ();
          });
        }
      });
    },
    yearChange1(year) {
      this.loadTrainingRecordsChart(year.getFullYear());
    },
    yearChange2(year) {
      this.loadMeetingRecordsChart(year.getFullYear());
    },
    yearChange3(year) {
      this.loadWorkingRelatedPartiesChart(year.getFullYear());
    },
    yearChange4(year) {
      this.loadWorkPermitChart(year.getFullYear());
    },
    yearChange5(year) {
      this.loadExamConstructionWorkChart(year.getFullYear());
    },
    yearChange6(year) {
      this.loadDerChart(year.getFullYear());
    },
    yearChange7(year) {
      this.loadHseChart(new Date(year));
    },
    getOption1() {
      return {
        legend: {
          orient: 'vertical',
          // left: 'right',
          top: 'middle',
          right: 0,
        },
        tooltip: {
          trigger: 'item'
        },
        noDataLoadingOption: {
          effect: "bubble",
          text: "暂无数据",
          effectOption: {
            effect: {
              n: 0
            }
          },
          textStyle: {
            fontSize: 32,
            fontWeight: 'bold'
          }
        },
        color: ['#FD5C50', '#FF9800', '#FDD835', '#40C4FF'],
        series: [
          {
            center: ['35%', '55%'],
            radius: ['40%', '60%'],
            name: '',
            type: 'pie',
            data: [],
            avoidLabelOverlap: false,
            itemStyle: {
              borderRadius: 10,
              borderColor: '#fff',
              borderWidth: 2,
            },
            label: {
              show: false,
              position: 'center'
            },
            emphasis: {
              label: {
                show: true,
                fontSize: '40',
                fontWeight: 'bold'
              }
            },
            labelLine: {
              show: false
            },
          }
        ]
      }
    },
    getOption2() {
      return {
        grid: {
          bottom: 0,
          left: 75,
          right: 0,
          top: 0
        },
        tooltip: {
          trigger: 'item',
        },
        xAxis: {
          type: 'value',
          boundaryGap: [0, 0.01],
          splitLine: {show: false}
        },
        yAxis: {
          type: 'category',
          data: [],
          splitLine: {show: false}
        },
        series: [
          {
            name: '学历分布',
            type: 'bar',
            data: [],
            label: {
              show: true,
              position: 'inside',
              formatter: '{c}'
            },
            itemStyle: { // 柱子样式
              color: {
                type: 'linear',
                x: 0,
                y: 0,
                x2: 1,
                y2: 1,
                colorStops: [{
                  offset: 0, color: '#71C8B1' // 0% 处的颜色
                }, {
                  offset: 0.5, color: '#44C0C1' // 100% 处的颜色
                }, {
                  offset: 1, color: '#06B5D7' // 100% 处的颜色
                }],
                global: false // 缺省为 false
              },
            },
          }
        ]
      };
    },
    getOption3() {
      return {
        grid: {
          bottom: 30,
          left: 0,
          right: 0,
          top: 20
        },
        tooltip: {
          trigger: 'item',
        },
        xAxis: {
          type: 'category',
          data: []
        },
        yAxis: {
          type: 'value',
          show: false,
        },
        series: [
          {
            name: '工作年限',
            data: [],
            type: 'bar',
            backgroundStyle: {
              color: 'rgba(180, 180, 180, 0.2)'
            },
            label: {
              show: true,
              position: 'top'
            },
            itemStyle: { // 柱子样式
              color: {
                type: 'linear',
                x: 0,
                y: 0,
                x2: 1,
                y2: 1,
                colorStops: [{
                  offset: 0, color: '#71C8B1' // 0% 处的颜色
                }, {
                  offset: 0.5, color: '#44C0C1' // 100% 处的颜色
                }, {
                  offset: 1, color: '#06B5D7' // 100% 处的颜色
                }],
                global: false // 缺省为 false
              }
            },
          }
        ]
      };
    },
    getOption4() {
      return {
        legend: {},
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'shadow'
          }
        },
        grid: {
          bottom: 20,
          left: 0,
          right: 0,
          top: 0
        },
        xAxis: {
          type: 'category',
          data: []
        },
        yAxis: {
          type: 'value',
          show: false,
        },
        series: []
      }
    },
    getOption5() {
      let option = {
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'shadow'
          }
        },
        grid: {
          top: 5,
          left: 100,
          right: 0,
          bottom: 0,
        },
        xAxis: {
          type: 'value',
          show: false,
          boundaryGap: [0, 0.01],
          splitLine: {show: false},
          axisTick: {show: false},
          axisLine: {show: false}
        },
        yAxis: {
          type: 'category',
          data: [],
          axisLine: {
            show: false,
            lineStyle: {
              color: '#757575'
            }
          },
          axisTick: {show: false}
        },
        series: [
          {
            name: '数量',
            type: 'bar',
            barWidth: 8,
            barGap: '80%',
            barCategoryGap: '50%',
            z: 10,
            data: [],
            itemStyle: { // 柱子样式
              normal: {
                barBorderRadius: [0, 10, 10, 0],
                color: '#42A5F5', // 柱状图颜色
                label: {
                  show: true, // 显示文本
                  position: 'right', // 数据值位置
                  textStyle: {
                    color: '#000'
                  },
                }
              }
            }
          },
          {
            type: 'bar',
            data: [46, 46, 46, 46, 46, 46, 46, 46],
            tooltip: {show: false},
            barMinHeight: 30,
            barWidth: 10,
            barMaxWidth: 100,
            barGap: '-100%', // 两个柱子之间的距离，如果要重叠设置为-100%
            itemStyle: {
              normal: {
                color: '#F0F2F5', // 柱子颜色，作为底层背景
                label: {
                  show: false,
                  position: 'right',
                  testStyle: {
                    color: '#000'
                  }
                }
              }
            }
          }
        ]
      };
      return option;
    },
    getOption6() {
      let option = {
        color: ['#1DE9B6', '#42A5F5'],
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'shadow'
          }
        },
        grid: {
          top: '20%',
          left: '3%',
          right: '4%',
          bottom: '1%',
          containLabel: true
        },
        xAxis: [
          {
            type: 'category',
            data: ['本期上报', '本期消除', '本期未消除', '上期未消除'],
            axisTick: {show: false},
            splitLine: {show: false},
            axisLine: {
              show: false,
              lineStyle: {
                color: '#757575'
              }
            },
            axisLabel: {
              fontSize: 12
            }
          }
        ],
        yAxis: [
          {
            type: 'value',
            axisTick: {show: false},
            axisLine: {
              show: false,
              lineStyle: {
                color: '#757575'
              }
            },
            axisLabel: {
              fontSize: 12
            }
          }
        ],
        series: [
          {
            type: 'bar',
            barGap: 0,
            barWidth: 18,
            barCategoryGap: '50%',
            data: [],
          },
        ]
      };
      return option;
    },
    getOption7() {
      let option = {
        grid: {
          left: '3%',
          right: '4%',
          top: '5%',
          bottom: '1%',
          containLabel: true
        },
        xAxis: {
          type: 'category',
          data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
          axisLine: {
            show: true,
            lineStyle: {
              color: '#4FC3F7'
            }
          },
          splitLine: {
            show: false,
          },
          axisTick: {
            show: false
          },
          axisLabel: {
            fontSize: 12,
            fontFamily: 'Microsoft YaHei',
            fontWeight: 400,
            color: '#4FC3F7'
          }
        },
        color: ['#4FC3F7'],
        yAxis: {
          type: 'value',
          axisLine: {
            show: true,
            lineStyle: {
              color: '#4FC3F7'
            }
          },
          minInterval: 1,
          splitLine: {
            show: false,
          },
          axisTick: {
            show: false
          },
          axisLabel: {
            fontSize: 12,
            fontFamily: 'Microsoft YaHei',
            fontWeight: 400,
            color: '#02c1fc'
          }
        },
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'cross',
            label: {
              backgroundColor: '#6a7985'
            }
          }
        },
        series: [{
          hoverAnimation: false,
          data: [333, 820, 932, 901, 934, 1290, 1330, 1320, 1400, 1500, 1600, 1700],
          type: 'line',
          smooth: true,
          lineStyle: {
            color: '#3dfad8'
          },
          areaStyle: {
            color: {
              type: 'linear',
              x: 0,
              y: 0,
              x2: 0,
              y2: 1,
              colorStops: [{
                offset: 0, color: '#06B5D7' // 0% 处的颜色
              }, {
                offset: 0.5, color: '#44C0C1' // 100% 处的颜色
              }, {
                offset: 1, color: '#71C8B1' // 100% 处的颜色
              }],
              global: false // 缺省为 false
            }
          }
        }]
      }
      return option;
    },
    queryHiddenDanger() {
      this.loading = true;
      let data2 = {
        type: this.clickParam.name == '本期上报' ? '1' : this.clickParam.name == '本期消除' ? '2' : this.clickParam.name == '本期未消除' ? '3' : this.clickParam.name == '上期未消除' ? 4 : 0,
        orgId: this.companyId,
        month: this.formatDate(this.year7, 'yyyy-MM'),
        lastMonth: this.getLastMonth(this.year7, 'yyyy-MM'),
        companyName: this.companyName,
        startPage: this.pagedata.fromPage,
        pageSize: this.pagedata.pageSize,
      }
      this.$http.get(Api.apsgInverstigation + '/count/detail', {params: data2}).then(r => {
        this.hiddenDangerInfo = r.data.data;
        this.pagedata.total = r.data.totalSize;
        this.loading = false;
      });
    },
    loadCockpitCount() {
      let date = new Date();
      let user = sessionStorage('userId').getObject('userId');
      let url = Api.cockpitCount + date.getFullYear() + '/' + this.companyId;
      this.$http.get(url).then(res => {
        if (res.data.status == 200) {
          this.statisticsInfos = res.data.data;
        }
      });
    },
    setQueryCompanyId(data) {
      this.companyId = data[0];
      this.loadChart();
      this.queryInfo();
      this.loadTrainingRecordsChart(this.year1.getFullYear());
      this.loadMeetingRecordsChart(this.year2.getFullYear());
      this.loadWorkPermitChart(this.year4.getFullYear());
      this.loadWorkingRelatedPartiesChart(this.year3.getFullYear());
      this.loadExamConstructionWorkChart(this.year5.getFullYear());
      this.loadDerChart(this.year6.getFullYear());
      this.loadHseChart(this.year7);
      this.loadSafeAccident();
      this.loadCockpitCount();
    },
    setQueryCompanyName(data) {
      this.companyName = data;
    },
    querySaStaffEnvinfo() {
      if (this.SaStaffEnvinfoType == "gender") {
        this.dataToQuery = {companyId: this.companyId, genderId: this.clickParam.name == "男" ? 'M' : 'F'};
      } else if (this.SaStaffEnvinfoType == "year") {
        this.dataToQuery = {
          companyId: this.companyId,
          workYearRange: this.clickParam.name == "1年" ? '0' :
              this.clickParam.name == "1-3年" ? '1' : this.clickParam.name == "3-5年" ? '2' : this.clickParam.name == "5-10年" ? '3' :
                  this.clickParam.name == "10年以上" ? '4' : '5'
        };
      } else if (this.SaStaffEnvinfoType == "education") {
        this.dataToQuery = {companyId: this.companyId, education: this.clickParam.name};
      } else if (this.SaStaffEnvinfoType == "age") {
        this.dataToQuery = {
          companyId: this.companyId, ageRange: this.clickParam.name == "0-15岁" ? '0' :
              this.clickParam.name == "16-25岁" ? '1' : this.clickParam.name == "26-35岁" ? '2' : this.clickParam.name == "36-45岁" ? '3' : '4'
        };
      }
      this.loading = true;
      let data = {
        startPage: this.pagedata.fromPage,
        size: this.pagedata.pageSize,
        conditions: this.dataToQuery
      };
      this.$http.post(Api.querySaStaffEnvinfo, data).then(r => {
        this.StaffInfo = r.data.data.data;
        this.pagedata.total = r.data.data.totalSize;
        this.loading = false;
      });
    },
    queryExamRecordInfo() {
      this.dataToQuery = {
        companyId: this.companyId,
        year: this.year5,
        repairStatus: this.clickParam.name
      }
      this.loading = true;
      let data = {
        startPage: this.pagedata.fromPage,
        size: this.pagedata.pageSize,
        conditions: this.dataToQuery
      };
      this.$http.post(Api.queryExamRecords.replace('ExamRecord', 'ExamRecord/work'), data).then(r => {
        this.ExamRecordInfo = r.data.data.data;
        this.pagedata.total = r.data.data.totalSize;
        this.loading = false;
      });
    },
    queryWorkingRelatedRarties() {
      this.dataToQuery = {
        companyId: this.companyId,
        startYear: this.year3,
        workStatus: this.clickParam.name == "计划中" ? '3' :
            this.clickParam.name == "进行中" ? '0' :
                this.clickParam.name == "已完成" ? '1' : '2'
      }
      this.loading = true;
      let data = {
        startPage: this.pagedata.fromPage,
        size: this.pagedata.pageSize,
        conditions: this.dataToQuery
      };
      this.$http.post(Api.queryWorkingRelatedRarties, data).then(r => {
        this.WorkingRelatedRartiesInfo = r.data.data.data;
        this.pagedata.total = r.data.data.totalSize;
        this.loading = false;
      });
    },
    queryMeetingRecordInfo() {
      this.dataToQuery = {
        companyId: this.companyId,
        year: this.year2,
        meetingType: this.clickParam.name == "公司安委会" ? 'TRA-000005000000002' :
            this.clickParam.name == "党组织会议" ? 'TRA-000005000000001' :
                this.clickParam.name == "公司环保例会" ? 'TRA-000005000000004' :
                    this.clickParam.name == "公司安全例会" ? 'TRA-000005000000003' : ''
      }
      this.loading = true;
      let data = {
        startPage: this.pagedata.fromPage,
        size: this.pagedata.pageSize,
        conditions: this.dataToQuery
      };
      this.$http.post(Api.queryMeetingRecordsByCompanyId, data).then(r => {
        this.meetingRecordInfo = r.data.data.data;
        this.pagedata.total = r.data.data.totalSize;
        this.loading = false;
      });
    },
    queryTrainingRecordInfo() {
      this.dataToQuery = {
        companyId: this.companyId,
        traOrgId: this.companyId,
        year: this.year1,
        type: this.clickParam.seriesName == "计划" ? '1' : '2',
        theme: 'TRA-000006000000001',
        trainingType: 'TR-000001000000001'
      };
      this.loading = true;
      let data = {
        startPage: this.pagedata.fromPage,
        size: this.pagedata.pageSize,
      };
      let url = Api.queryTrainingScheduleByCompanyId;
      if (this.dataToQuery.type == '2') {
        data.conditions = this.dataToQuery
        this.trainingRecordVisible = true;
        url = Api.queryTrainingRecordsByCompanyId;
        this.$http.post(url, data).then(r => {
          this.trainingRecordInfo = r.data.data.data;
          this.pagedata.total = r.data.data.totalSize;
          this.loading = false;
        });
      } else {
        this.trainingScheduleVisible = true;
        data = Object.assign(data, JSON.parse(JSON.stringify(this.dataToQuery)));
        this.$http.get(url + "/" + this.companyId, {params: data}).then(r => {
          this.trainingScheduleInfo = r.data.data.data;
          this.pagedata.total = r.data.data.totalSize;
          this.loading = false;
        });
      }
    },
    toViewJC() {
      this.pagedata = {
        total: 0, //总条数
        fromPage: 1,//从n条开始
        pageSize: 10//每页多少条
      };
      this.AQJCVisible = true;
      this.ZSSWVisible = false;
      this.ZDWRVisible = false;
      this.AQXZVisible = false;
      this.AQSGVisible = false;
      this.StatisticsVisible = true;
      this.loading = true;
      this.StaffTitle = '政府安全检查';
      this.queryJC();
    },
    queryJC() {
      this.loading = true;
      let date = new Date;
      let url = Api.cockpitCount + '/detail/' + this.companyId + '/' + date.getFullYear() + '/2?startPage=' + this.pagedata.fromPage + "&size=" + this.pagedata.pageSize;
      this.$http.get(url).then((res) => {
        this.pagedata.total = res.data.data.totalSize;
        this.dataTable = res.data.data.data;
        this.loading = false;
      }).catch(e => {
        this.$Message.error("数据获取失败")
      })
      this.$http.get(Api.cockpitCount + 'detail/count/' + this.companyId + '/' + date.getFullYear() + '/2').then((res) => {
        let container = echarts.init(this.$refs.analysisContainer);
        let option = this.getInspectOption(2);
        let legend = this.inspectData2;
        let temp = 0;
        legend.forEach(i => {
          res.data.data.forEach(j => {
            if (i == j['codingName']) {
              option.series.push({
                name: j['codingName'],
                type: 'bar',
                label: {
                  normal: {
                    show: true,
                    textBorderColor: '#333',
                    textBorderWidth: 2
                  }
                },
                data: j['count']
              });
              temp = 1;
            }
          });
          if (temp != 1) {
            option.series.push({
              name: i,
              type: 'bar',
              label: {
                normal: {
                  show: true,
                  textBorderColor: '#333',
                  textBorderWidth: 2
                }
              },
              data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
            });
            temp = 0;
          }

        })
        container.setOption(option);
      }).catch(e => {
        this.$Message.error("数据获取失败")
      })
    },
    lowerStep(name) {
      this.modaleshow = name
      this.toViewRisk(this.riskLevelType)
    },
    toViewRisk() {
      this.riskLevelVisible = true;
      var date = new Date();
      this.loading = true;
      let url = ''
      if (this.modaleshow == 1) {
        url = Api.equipmentFacilitiesRiskApprovalList
      } else if (this.modaleshow == 2) {
        url = Api.workProcessRiskApprovalList
      } else if (this.modaleshow == 3) {
        url = Api.personnelJobRiskApprovalList
      } else if (this.modaleshow == 4) {
        url = Api.environmentalRiskApprovalList
      }
      let data = {
        startPage: this.pagedata.fromPage,
        size: this.pagedata.pageSize,
        year: this.year6,
        orgId: this.companyId,
        belongOrgName: this.companyName,
//        rikRankId: name == null ? '' : name === '重大' ? '重大' : name === '较大' ? '较大' : '重大,较大'
        rikRankId: this.clickParam.name == null ? '' : this.clickParam.name
      }
      data = Object.assign(data);
      this.$http.get(url, {params: data}).then((res) => {
        res.data.data.data.forEach(item => {
          const sty = item.rikColor == '红' ? 'table-info-cell-red' : item.rikColor == '橙' ? 'table-info-cell-orage' : item.rikColor == '黄' ? 'table-info-cell-yellow' : item.rikColor == '蓝' ? 'table-info-cell-blue' : ''
          item.cellClassName = {rikColor: sty}
        })
        this.riskLevelInfo = res.data.data.data;
        this.pagedata.total = res.data.data.totalSize;
        this.loading = false;
      }).catch(e => {
        this.$Message.error("数据获取失败")
        this.loading = false;
        this.pagedata.total = 0
      })
    },
    getInspectOption() {
      let option = {
        color: this.color,
        legend: {
          data: this.inspectData2
        },
        xAxis: [
          {
            type: 'category',
            axisTick: {show: false},
            data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
          }
        ],
        yAxis: [
          {
            type: 'value'
          }
        ],
        series: []
      };
      return option;
    },
    queryAQSGTJ() {
      this.loading = true;
      let date = new Date();
      let month = this.clickParam.name == '1月' ? '01' : this.clickParam.name == '2月' ? '02' : this.clickParam.name == '3月' ? '03' : this.clickParam.name == '4月' ? '04' : this.clickParam.name == '5月' ? '05' : this.clickParam.name == '6月' ? '06' : this.clickParam.name == '7月' ? '07' : this.clickParam.name == '8月' ? '08' : this.clickParam.name == '9月' ? '09' : this.clickParam.name == '10月' ? '10' : this.clickParam.name == '11月' ? 11 : this.clickParam.name == '12月' ? 12 : 0;
      let data = {
        startPage: this.pagedata.fromPage,
        size: this.pagedata.pageSize,
        //orgId:sessionStorage('userId').getObject('userId').companyId,
        procinstState: '3',
        year: date.getFullYear() + "-" + month
      };
      let url = Api.briefing
      this.$http.get(url, {params: data}).then((res) => {
        this.dataTable = res.data.data.data;
        this.pagedata.total = res.data.data.totalSize;
        this.loading = false;
      }).catch(e => {
        this.$Message.error("数据获取失败")
      })
    },
    toViewZWUTQYJ() {
      this.pagedata = {
        total: 0, //总条数
        fromPage: 1,//从n条开始
        pageSize: 10//每页多少条
      };
      this.ZDWRVisible = true;
      this.AQJCVisible = false;
      this.ZSSWVisible = false;
      this.AQXZVisible = false;
      this.AQSGVisible = false;
      this.loading = true;
      this.StatisticsVisible = true;
      this.StaffTitle = '重污染天气预警';
      this.queryZWUTQYJ();
    },
    queryZWUTQYJ() {
      this.loading = true;
      let date = new Date;
      let url = Api.cockpitCount + '/warningDays/' + this.companyId + '/' + date.getFullYear();
      this.$http.get(url + "?startPage=" + this.pagedata.fromPage + "&size=" + this.pagedata.pageSize).then((res) => {
        if (res.data.data.data.length > 0) {
          res.data.data.data.forEach(item => {
            const sty = item.warningLevel == '红色' ? 'table-info-cell-red' : item.warningLevel == '橙色' ? 'table-info-cell-orage' : item.warningLevel == '黄色' ? 'table-info-cell-yellow' : item.warningLevel == '蓝色' ? 'table-info-cell-blue' : ''
            item.cellClassName = {warningLevel: sty}
          })
        }
        this.pagedata.total = res.data.data.totalSize;
        this.dataTable = res.data.data.data;
        this.loading = false;
      }).catch(e => {
        this.$Message.error("数据获取失败")
      })
    },
    toViewZSSW() {
      this.pagedata = {
        total: 0, //总条数
        fromPage: 1,//从n条开始
        pageSize: 10//每页多少条
      };
      this.ZSSWVisible = true;
      this.AQJCVisible = false;
      this.ZDWRVisible = false;
      this.AQXZVisible = false;
      this.AQSGVisible = false;
      this.loading = true;
      this.StatisticsVisible = true;
      this.StaffTitle = '重伤以上详情';
      this.queryZSSW();
    },
    queryZSSW() {
      let date = new Date;
      let data = {
        startPage: this.pagedata.fromPage,
        size: this.pagedata.pageSize,
        orgId: sessionStorage('userId').getObject('userId').companyId,
        year: date.getFullYear(),
        procinstState: '3',
        injuryLevels: '1000001019000000002,1000001019000000003,',
        memberships: 'MEM-000001000000001,MEM-000001000000002,MEM-000001000000003,',
        notAccTypeId: 'ACC-000001000000019',
      };
      let url = Api.briefing
      this.$http.get(url, {params: data}).then((res) => {
        this.dataTable = res.data.data.data;
        this.pagedata.total = res.data.data.totalSize;
        this.loading = false;
      }).catch(e => {
        this.$Message.error("数据获取失败")
      })
      this.$http.get(url + '/count', {params: data}).then((res) => {
        if (res.data.status == 200) {
          let option = this.getBriefingOption();
          let container = echarts.init(this.$refs.analysisContainer);
          res.data.data.forEach(item => {
            option.legend.data.push(item['codingName']);
            option.series.push({
              name: item['codingName'],
              type: 'bar',
              label: {
                normal: {
                  show: true,
                  textBorderColor: '#333',
                  textBorderWidth: 2
                }
              },
              data: item['count']
            });
          })
          container.setOption(option);
        }
      }).catch(e => {
        this.$Message.error("数据获取失败")
      });
    },
    toViewAQXZ() {
      this.pagedata = {
        total: 0, //总条数
        fromPage: 1,//从n条开始
        pageSize: 10//每页多少条
      };
      this.StaffTitle = "安全行政处罚详情"
      this.StatisticsVisible = true;
      if (this.statisticsInfos.furloughNum > 0) {
        this.AQJCVisible = false;
        this.ZSSWVisible = false;
        this.ZDWRVisible = false;
        this.AQXZVisible = true;
        this.AQSGVisible = false;
        this.queryAQXZ();
      } else {
        this.AQJCVisible = false;
        this.ZDWRVisible = false;
        this.ZSSWVisible = false;
        this.AQXZVisible = true;
        this.AQSGVisible = false;
        this.dataTable = [];
        this.pagedata.total = 0;
      }
    },
    queryAQXZ() {
      this.loading = true;
      var date = new Date();
      let data = {
        startPage: this.pagedata1.fromPage,
        size: this.pagedata1.pageSize,
        orgId: sessionStorage('userId').getObject('userId').companyId,
        year: date.getFullYear()
      };
      let url = Api.SaAdministrativeSanctionQuery
      this.$http.get(url, {params: data}).then((res) => {
        this.dataTable = res.data.data.data;
        this.pagedata1.total = res.data.data.totalSize;
        this.loading = false;
      }).catch(e => {
        this.$Message.error("数据获取失败")
      })
      let countUrl = Api.SaAdministrativeSanctionCount;
      this.$http.get(countUrl, {
        params: {
          orgId: sessionStorage('userId').getObject('userId').companyId,
          year: date.getFullYear()
        }
      }).then((res) => {
        if (res.data.status == 200) {
          let container = echarts.init(this.$refs.analysisContainer);
          let option = this.getMeetingOption();
          option.series.push({
            type: 'bar',
            label: {
              normal: {
                show: true,
                textBorderColor: '#333',
                textBorderWidth: 2
              }
            },
            data: res.data.data
          });
          container.setOption(option);
        }
      }).catch(e => {
        this.$Message.error("数据获取失败")
      })

    },
    queryZYXK() {
      this.loading = true;
      let data2 = {
        ptwTypeName: this.ZYXKTitle,
        companyId: this.companyId,
        year: this.year4,
        currentPage: this.pagedata.fromPage,
        size: this.pagedata.pageSize,
      }
      this.$http.get(Api.getPtwList, {params: data2}).then(r => {
        this.ZYXKInfo = r.data.data;
        this.ZYXKInfo.forEach(item => {
          if (item.modelType == "ptw-100001000000004") {
            if (item.workGrade == 'ptw-100003000000001')
              item.workGradeName = "特级：＞30米";
            if (item.workGrade == 'ptw-100003000000002')
              item.workGradeName = "三级：15-30米";
            if (item.workGrade == 'ptw-100003000000003')
              item.workGradeName = "二级：5-15米";
            if (item.workGrade == 'ptw-100003000000004')
              item.workGradeName = "一级：1.8—5米";
          }
          if (item.modelType == "ptw-100001000000001") {
            if (item.workGrade == 'ptw-100003000000001')
              item.workGradeName = "一级吊装";
            if (item.workGrade == 'ptw-100003000000002')
              item.workGradeName = "二级吊装";
            if (item.workGrade == 'ptw-100003000000003')
              item.workGradeName = "三级吊装";
          }
          if (item.modelType == "ptw-100001000000005") {
            if (item.workGrade == 'ptw-100003000000001')
              item.workGradeName = "特殊动火";
            if (item.workGrade == 'ptw-100003000000002')
              item.workGradeName = "一级动火";
            if (item.workGrade == 'ptw-100003000000003')
              item.workGradeName = "二级动火";
          }
          if (item.modelType == "ptw-100001000000003") {
            if (item.workGrade == 'ptw-100003000000001')
              item.workGradeName = "特级";
            if (item.workGrade == 'ptw-100003000000002')
              item.workGradeName = "一级";
            if (item.workGrade == 'ptw-100003000000003')
              item.workGradeName = "二级";
          }
          if (item.modelType == "ptw-100001000000002") {
            item.workGradeName = "清库";
          }
          if (item.modelType == "ptw-100001000000006") {
            item.workGradeName = "预热器人工清堵";
          }
          if (item.modelType == "ptw-100001000000007") {
            item.workGradeName = "篦冷机清大块";
          }
          if (item.modelType == "ptw-100001000000008") {
            item.workGradeName = "临时用电";
          }
          if (item.modelType == "ptw-100001000000011") {
            if (item.workGrade == 'ptw-100003000000001')
              item.workGradeName = "主干道";
            if (item.workGrade == 'ptw-100003000000002')
              item.workGradeName = "次干道";
          }
          if (item.modelType == "ptw-100001000000010") {
            if (item.workGrade == 'ptw-100003000000001')
              item.workGradeName = "2个施工队伍交叉作业";
            if (item.workGrade == 'ptw-100003000000002')
              item.workGradeName = "2个以上施工队伍交叉作业";
          }
        })
        this.pagedata.total = r.data.totalSize;
        this.loading = false;
      });
    },
    reset() {
      this.companyInfo = {
        value: sessionStorage('userId').getObject('userId').companyId,
        label: sessionStorage('userId').getObject('userId').companyName,
      },
          this.setQueryCompanyId([sessionStorage('userId').getObject('userId').companyId])
      setTimeout(() => {
        this.$refs.queryOrgCascader.setCurrentOrg();
      }, 100)
    },
    getBriefingOption() {
      let option = {
        color: this.color,
        legend: {
          data: []
        },
        xAxis: [
          {
            type: 'category',
            axisTick: {show: false},
            data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
          }
        ],
        yAxis: [
          {
            type: 'value'
          }
        ],
        series: []
      };
      return option;
    },
    getBriefingCountOption() {
      let option = {
        color: this.color,
        legend: {
          data: []
        },
        xAxis: [
          {
            type: 'category',
            axisTick: {show: false},
            data: []
          }
        ],
        yAxis: [
          {
            type: 'value'
          }
        ],
        series: []
      };
      return option;
    },
    getMeetingOption() {
      let option = {
        color: this.color,
        legend: {
          data: []
        },
        xAxis: [
          {
            type: 'category',
            axisTick: {show: false},
            data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
          }
        ],
        yAxis: [
          {
            type: 'value'
          }
        ],
        series: []
      };
      return option;
    },
    formatDate(date, fmt) {
      if (/(y+)/.test(fmt)) {
        fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
      }
      let o = {
        'M+': date.getMonth() + 1,
        'd+': date.getDate(),
        'h+': date.getHours(),
        'm+': date.getMinutes(),
        's+': date.getSeconds()
      };
      for (let k in o) {
        if (new RegExp(`(${k})`).test(fmt)) {
          let str = o[k] + '';
          fmt = fmt.replace(RegExp.$1, RegExp.$1.length === 1 ? str : this.padLeftZero(str));
        }
      }
      return fmt;
    },
    padLeftZero(str) {
      return ('00' + str).substr(str.length);
    },
    getLastMonth(date, fmt) {
      if (typeof date == 'string') {
        return date;
      }
      if (!fmt) fmt = "yyyy-MM-dd hh:mm:ss";
      if (!date || date == null) return null;
      let month = 0;
      if (date.getMonth() == 0) {
        date = new Date(date.getFullYear() - 1, 12, 1);
        date.getMonth() + 1;
      } else {
        month = date.getMonth();
      }
      let o = {
        'M+': month, // 月份
        'd+': date.getDate(), // 日
        'h+': date.getHours(), // 小时
        'm+': date.getMinutes(), // 分
        's+': date.getSeconds(), // 秒
        'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
        'S': date.getMilliseconds() // 毫秒
      }
      if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
      for (let k in o) {
        if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
      }
      return fmt
    },
  }
}
</script>

<style scoped>
@import "../../../index.css";

.span_title {
  border-left: 3px solid red;
  padding-left: 5px;
  font-weight: bold;
  font-size: 16px;
  margin-right: 15px
}

.info_div_left {
  display: table-cell;
  float: left;
  width: 35%;
  height: 136px;
  line-height: 136px
}

.info_div_left img {
  width: 70px;
  height: 70px;
  display: inline-block;
  vertical-align: middle;
}

.info_div_right {
  display: table-cell;
  vertical-align: middle;
  height: 136px;
  width: 65%
}

.info_div_right span {
  font-size: 18px;
  font-weight: bold
}
</style>
